﻿@model IEnumerable<Stardust.Models.UsuarioBean>

@{
    ViewBag.Title = "Usuarios";
}

@if (!String.IsNullOrEmpty(ViewBag.results)) { 
    <div class="nNote nWarning hideit">
        <p><strong>AVISO: </strong>@ViewBag.results</p>
    </div>
}

<h2>Usuarios</h2>

@using( Html.BeginForm( "Buscar" , "Usuario" , FormMethod.Post , new { @class = "form" } ) ){
    <fieldset>
        <div class = "widget" >
            <div class = "title"><h6>Buscar Usuario</h6></div>

            <div class="formRow">
                <label>Cuenta de usuario</label>
                <div class = "formRight" ><input type = "text" id = "account" name = "account" /></div>
                <div class = "clear" ></div>
            </div>
            
            <div class="formRow">
                <label>Nombre</label>
                <div class = "formRight" ><input type = "text" id = "nombre" name = "nombre" /></div>
                <div class = "clear" ></div>
            </div>

            <div class="formRow">
                <label>Apellido Paterno</label>
                <div class = "formRight" ><input type = "text" id = "apPat" name = "apPat" /></div>
                <div class = "clear" ></div>
            </div>

            <div class="formRow">
                <label>Apellido Materno</label>
                <div class = "formRight" ><input type = "text" id = "apMat" name = "apMat" /></div>
                <div class = "clear" ></div>
            </div>

            <div class = "formRow" >
                <label>Tipo de documento</label>
                <div class = "formRight" > @Html.DropDownList( "tipoDocumento" , new SelectList( ViewBag.documentos , "nombre" , "nombre" ) , "Elije un tipo de documento..." ) </div>
                <div class = "clear" ></div>
            </div>

            <div class = "formRow" >
                <label>Nro. Documento</label>
                <div class = "formRight" ><input type = "text" id = "nroDocumento" name = "nroDocumento" /></div>
                <div class = "clear" ></div>
            </div>
        </div>
    </fieldset>
    <p>
        <input type="submit" value="Buscar" class = "redB" />
    </p>
}

<p></p><p></p>


<table cellpadding = "0" cellspacing = "0" width = "100%" class = "sTable">
    <thead>
        <tr>
            <td>Usuario</td>
            <td>E-mail</td>
            <td>Perfil de usuario</td>
            <td>Estado</td>
            <td></td>
        </tr>
    </thead>

    <tbody>
    @foreach (var item in Model)
    {
        <tr>
            <td>@Html.DisplayFor(modelItem => item.user_account)</td>
            <td>@Html.DisplayFor(modelItem => item.email)</td>
            <td>@Html.DisplayFor(modelItem => item.nombrePerfilUsuario)</td>
            <td>@Html.DisplayFor(modelItem => item.estado)</td>
            <td>
                <a href="@Url.Action("Edit", new { id = item.ID })"><img src="../../Content/images/icons/color/pencil.png", alt="Edit" />Editar </a> | 
                <a href="@Url.Action("Details", new { id = item.ID })"><img src="../../Content/images/icons/color/edit-column.png", alt="Details" />Detalles</a> | 
                <a href="@Url.Action("Delete", new { id = item.ID })"><img src="../../Content/images/icons/color/cross.png", alt="Delete" />Borrar</a>
            </td>
        </tr>
        
    }
    </tbody>
</table>